<template>
  <div id='app'>
<RouterTo :title="title"></RouterTo>

<div class="renqi">
  <ul>
    <li v-for="(c,i) in list" :key="i" @click="detail(c)">
      <img :src="c.pic" alt="">
      <p>{{c.name}}</p>
      <p>{{c.characteristic}}</p>
      <p >￥{{c.minPrice}}</p>
    </li>
  </ul>

</div>
  </div>
</template>

<script>
import RouterTo from '../../components/hedaerTO/routerTo'

export default {
  data () {
    return {
      list: [],
      title:'人气推荐'
    }
  },
  methods: {
      get(){
          this.$request.shoppingCart({
              size:'1',
              pageSize:'28'
          }).then(res=>{
              console.log(res.data.data);
              this.list=res.data.data
          })

      },
      detail(c){
        this.$router.push(
          {
            path:this.$routerConfig.detail.path,
            query:{
              id:c.id,
              pic:c.pic,
              name:c.name,
              characteristic:c.characteristic,
              minPrice:c.minPrice,
              }

          }
          
          
          
          )

    }

  },
  mounted() {
      this.get()

  },
  components: {
RouterTo
  }
}
</script>

<style lang='scss'>

</style>
